package adv5;

import java.util.Calendar;

/**
 * @author oldliu
 * @since 1.0
 */
public class FindSunday {
    public static void main(String[] args) {
        //找周日
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.MONTH,0);
        int year = calendar.get(Calendar.YEAR);
        int day = Calendar.SUNDAY;
        calendar.set(calendar.DAY_OF_WEEK,day);
        System.out.println("周日：");
        while (year==calendar.get(Calendar.YEAR)){
            System.out.println(calendar.getTime());
            calendar.add(Calendar.DATE,7);
        }
    }
}
